import 'package:flutter/material.dart';

class RegisterPage4 extends StatefulWidget {
  const RegisterPage4({Key? key}) : super(key: key);

  @override
  _RegisterPageState4 createState() => _RegisterPageState4();
}

class _RegisterPageState4 extends State<RegisterPage4> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
        title: Text('浏览历史'),
    backgroundColor: Colors.purple,
    elevation: 0, // 移除阴影
    ),
    body: Column(
      children: [
        Expanded(
          child: ListView.builder(
            itemCount: 10, // 假设有10条历史记录
            itemBuilder: (BuildContext context, int index) {
              return Padding(
                padding: const EdgeInsets.all(8.0),
                child: Card(
                  elevation: 4.0,
                  child: ListTile(
                    leading: Icon(
                      Icons.history,
                      color: Colors.purple[500], // 图标颜色为紫色
                    ),
                    title: Text(
                      '商品标题 ${index + 1}',
                      style: TextStyle(color: Colors.black87), // 标题颜色为深灰色
                    ),
                    subtitle: Text(
                      '浏览时间：2024-04-${index + 1}',
                      style: TextStyle(color: Colors.grey[500]), // 副标题颜色为灰色
                    ),
                    trailing: IconButton(
                      icon: Icon(Icons.delete, color: Colors.red),
                      onPressed: () {
                        // 删除操作逻辑
                      },
                    ),
                  ),
                ),
              );
            },
          ),
        ),
        Divider( // 分隔线，可选
          thickness: 1.0,
          color: Colors.grey[300],
        ),
        Padding(
          padding: const EdgeInsets.all(16.0),
          child: Text(
            '查看更多历史记录',
            style: TextStyle(color: Colors.purple[500], fontSize: 16.0),
          ),
        ),
      ],
    ),
      bottomNavigationBar: BottomNavigationBar(
        showSelectedLabels: true,
        // 如果想要隐藏选中时的文字
        showUnselectedLabels: true,
        // 如果想要显示未选中时的文字
        type: BottomNavigationBarType.fixed,

        selectedItemColor: Colors.purple,
        // 选中项的颜色
        unselectedItemColor: Colors.grey,
        // 未选中项的颜色

        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Icon(Icons.history),
            label: '历史记录',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: '首页',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.face),
            label: '我的',
          ),
        ],
      ),
    );
  }
}